const path = require('path')

function resolve (dir) {
  return path.join(__dirname, '.', dir)
}

module.exports = {
  // 兼容es6低版本浏览器
  configureWebpack: config => {
    config.entry.app = ['@babel/polyfill', './src/main.js']
  },
  pages: {
    index: {
      entry: 'src/main.js',
      title: process.env.VUE_APP_TITLE
    }
  },
  publicPath: process.env.VUE_APP_BASE_URL,
  css: {
    loaderOptions: {
      stylus: {
        'resolve url': true,
        import: [
          './src/theme',
          './src/stylus/index'
        ]
      }
    }
  },
  pluginOptions: {
    'cube-ui': {
      postCompile: true,
      theme: true
    }
  }
}
